Skip to content

Add support for Vector2/3/4, Quaternion, Rect; expand support for RGB-only Color#89

Open
kaycodes13 wants to merge 13 commits into
silksong-modding:mainfrom
kaycodes13:feature/vector-input
Open

Add support for Vector2/3/4, Quaternion, Rect; expand support for RGB-only Color#89
kaycodes13 wants to merge 13 commits into
silksong-modding:mainfrom
kaycodes13:feature/vector-input

Conversation

@kaycodes13
Copy link
Copy Markdown
Contributor

@kaycodes13 kaycodes13 commented May 5, 2026

Summary of Changes

Closes #78 by:

  • Adding a set of TextModels utilities to create models for Vector2, Vector3, Vector4, Quaternion, and Rect types.
  • Adding custom input validation for those types to TextInput.
  • Adding a set of methods for generating elements for those types in ConfigEntryFactory and MenuProperty.

Other updates folded into this:

  • Added an RGBElementFactory for source generation of color inputs that mirrors the effect that RGBColorValues has for config entry element generation.
  • Added an underline to text fields, because I think it's a little confusing to encounter an empty text field without any visual indication that there's a spot to type something.

Checklist

  • No change is too small for a release, so pick one:
    • I have updated the package version following semantic versioning
    • There is another change actively WIP that will update the version ( More intuitive navigation between groups #85 )
    • This PR does not update user-facing code/config
    • I'm not sure how to set the version and would like the reviewer's help

Comment thread Silksong.ModMenu/Models/TextModels.cs Outdated
Comment thread Silksong.ModMenu/Elements/TextInput.cs
Comment thread Silksong.ModMenu/Plugin/ConfigEntryFactory.cs
Comment thread Silksong.ModMenu/Plugin/ConfigEntryFactory.cs
@kaycodes13 kaycodes13 changed the title Add TextModels and automatic element generation for Vector2/3/4 and Quaternion Add support for Vector2/3/4, Quaternion, and Rect inputs; add Color to source generation May 6, 2026
Comment thread Silksong.ModMenu/Generator/Attributes.cs Outdated
Copy link
Copy Markdown
Collaborator

@dplochcoder dplochcoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LG, just a couple comments left + Flib's comment about the RGB attribute

Comment thread Silksong.ModMenu/Elements/TextInput.cs
Comment thread Silksong.ModMenuAnalyzers/MenuProperty.cs Outdated
Comment thread Silksong.ModMenu/Plugin/ConfigEntryFactory.cs
@kaycodes13 kaycodes13 changed the title Add support for Vector2/3/4, Quaternion, and Rect inputs; add Color to source generation Add support for Vector2/3/4, Quaternion, Rect; expand support for RGB-only Color May 8, 2026
textInputChild.FindChild("CursorRight")!.GetComponent<Animator>(),
];

GameObject underlineObj = new("Underline") { layer = (int)PhysLayers.UI };
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How wedded are you to this underline? I think it looked better without the underline, personally

(To be clear, I don't mean we should keep - or remove - it based solely on my opinion, but I'd like it to be scrutinized further)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern with text inputs is making what they are more immediately obvious. Without anything to make it visually distinct from other similar controls, a filled text field looks very similar to a choice element, and an empty text field looks like the choices for a choice element didn't load. Hovering over or otherwise navigating to a text field puts a selection effect or caret on it to make it clear what it is, sure, but the initial impression is still unclear.

My reasoning for choosing a thin underline is because it's familiar visual language for this kind of input - anyone who's filled out a paper form has seen an underline somewhere you're supposed to write something. It's a choice that favours clarity over aesthetics. But if someone has an idea for how to get better aesthetics and similar clarity, sure, I say we try it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never thought they weren’t obvious without the line but I’ll have to have another look to judge. I do care a lot about aesthetics though so if there’s a better way to achieve what you want then that’d be good

Comment thread Silksong.ModMenu/Directory.Build.props Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add menu elements for Vector2/3/4 and Quaternion types

3 participants